package com.example.administrator.testc.FragmentTabHost;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.example.administrator.testc.R;

public class FragmentPage extends Fragment{


    private int [] IR = new int[]{R.drawable.share_sel_icon, R.drawable.point_sel, R.drawable.home_sel_icon};

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_, null);
        int i = (int)(Math.random() * 20) % 3;
        Log.i("TAGSS", "i is " + i);

        if (i == 3){
            getFragmentManager().beginTransaction().add(R.id.f_ll , new FragmentPage1()).commit();
        }else{
            ((ImageView)view.findViewById(R.id.imageview)).setImageResource(IR[i]);
        }

        return view;
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


    }
}
